Skip to main content

ARDK for Android/com.nianticlabs.ardk/AnchorUpdate

AnchorUpdate

[androidJvm]
data class AnchorUpdate(val uuid: UUID, val anchorToLocalTrackingTransform: Pose, val trackingState: AnchorTrackingState, val trackingStateReason: AnchorTrackingStateReason, val trackingConfidence: Float, val timestampMs: Long)

Contains the latest tracking information for a VPS anchor.

AnchorUpdate provides comprehensive information about an anchor's current state, including its pose, tracking quality, and status information. This data is updated as VPS refines its localization.

Overview​

Anchor updates are retrieved via getAnchorUpdate(uuid) and provide the most current information about an anchor's position, orientation, and tracking status. The data includes confidence metrics and timestamps for quality assessment.

Example​

val update = vpsSession.getAnchorUpdate(anchorId)
println("Anchor ID: ${update.uuid}")
println("Pose: ${update.anchorToLocalTrackingTransform}")
println("Tracking State: ${update.trackingState}")
println("Confidence: ${update.trackingConfidence}")

if (update.trackingState == AnchorTrackingState.TRACKED && update.trackingConfidence 0.8f) {
// Use anchor pose for AR content placement
placeARContent(update.anchorToLocalTrackingTransform)
}

Constructors​

AnchorUpdate[androidJvm]
constructor(uuid: ByteArray, anchorToLocalTrackingTransform: Pose, trackingStateValue: Int, trackingStateReasonValue: Int, trackingConfidence: Float, timestampMs: Long)constructor(uuid: UUID, anchorToLocalTrackingTransform: Pose, trackingState: AnchorTrackingState, trackingStateReason: AnchorTrackingStateReason, trackingConfidence: Float, timestampMs: Long)

Properties​

NameSummary
anchorToLocalTrackingTransform[androidJvm]
val anchorToLocalTrackingTransform: Pose
The 4x4 transformation matrix from anchor space to local tracking space.
timestampMs[androidJvm]
val timestampMs: Long
Timestamp when this update was generated (in milliseconds since epoch).
trackingConfidence[androidJvm]
val trackingConfidence: Float
Confidence score for the current tracking estimate.
trackingState[androidJvm]
val trackingState: AnchorTrackingState
The current tracking state of the anchor.
trackingStateReason[androidJvm]
val trackingStateReason: AnchorTrackingStateReason
Additional context about the tracking state.
uuid[androidJvm]
val uuid: UUID
The unique identifier of the anchor.